﻿@using XStudio.XCRF.Data.Entities.CureInfo
@using XStudio.XCRF.Web.Models.Enums
@model CureInfo
@(Html.Telerik().Grid<CureChemo>().Name("CureChemoViewGrid").Footer(false)
.DataKeys(keys => keys.Add(chemo => chemo.ID))
.Columns(columns =>
{
    columns.ForeignKey(chemo => chemo.Scheme, ChemoSchemeTypeInfo.SelectListItems, "Value", "Text").Title("方案").EditorTemplateName("ChemoScheme");
    columns.BoundDate(chemo => chemo.StartTime).Title("开始时间").EditorTemplateName("Date");
    columns.BoundDate(chemo => chemo.EndTime).Title("结束时间").EditorTemplateName("Date");
    columns.Bound(chemo => chemo.Remark).Title("备注");
    columns.Command(commands =>
    {
        commands.Edit().ButtonType(GridButtonType.Text);
        commands.Delete().ButtonType(GridButtonType.Text);
    }).Title("操作");
})
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text))
.DataBinding(dataBinding =>
{
    dataBinding.Ajax()
        .Select<CureInfoController>(c => c._CureChemoList(Model.ID))
        .Insert<CureInfoController>(c => c._CureChemoAdd(null, Model.ID))
        .Update<CureInfoController>(c => c._CureChemoEdit(null))
        .Delete<CureInfoController>(c => c._CureChemoDelete(null));
})
.Editable(edit => edit.Mode(GridEditMode.InLine))
)